package com.example.cv.service.iml;

import com.example.cv.mapper.EmployerMapper;
import com.example.cv.model.Candidate;
import com.example.cv.model.Employer;
import com.example.cv.model.Position;
import com.example.cv.service.EmployerService;
import javafx.geometry.Pos;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周杰
 */
@Service
public class EmployerServiceImpl implements EmployerService {
    public EmployerMapper employerMapper;

    @Autowired
    public void setEmployerDao(EmployerMapper employerMapper) {
        this.employerMapper = employerMapper;
    }
    @Override
    public Employer findEmployer(Employer employer) {
        return employerMapper.findEmployer(employer);
    }

    @Override
    public boolean addEmployer(Employer employer) {
        return employerMapper.addEmployer(employer);
    }

    @Override
    public List<Candidate> findAllCandidates() {
        return employerMapper.findAllCandidates();
    }

    @Override
    public List<Candidate> findCandidatesByParams(Candidate candidate) {
        return employerMapper.findCandidatesByParams(candidate);
    }

    @Override
    public Employer findEmployerById(int e_id) {
        return employerMapper.findEmployerById(e_id);
    }

    @Override
    public boolean updatePosReleaseTime(Position position) {
        return employerMapper.updatePosReleaseTime(position);
    }

    @Override
    public boolean deletePosReleaseTime(Position position) {
        return employerMapper.deletePosReleaseTime(position);
    }

    @Override
    public boolean updateEmployer(Employer employer) {
        return employerMapper.updateEmployer(employer);
    }

    @Override
    public List<Candidate> findRecommendCandidates(int e_id) {
        return employerMapper.findRecommendCandidates(e_id);
    }

    @Override
    public List<Position> findAllPositionsByEId(int e_id) {
        return employerMapper.findAllPositionsByEId(e_id);
    }

    @Override
    public List<Position> findPositionsByName(int e_id, String pos_name) {
        return employerMapper.findPositionsByName(e_id,pos_name);
    }

    @Override
    public boolean addPosition(Position position) {
        return employerMapper.addPosition(position);
    }

    @Override
    public Position findPositionByPId(int p_id) {
        return employerMapper.findPositionByPId(p_id);
    }

    @Override
    public boolean updatePosition(Position position) {
        return employerMapper.updatePosition(position);
    }

    @Override
    public boolean deletePosition(int p_id) {
        return employerMapper.deletePosition(p_id);
    }
}
